package com.wingice.system.entity;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;

/**
 * <p>
 * 用户信息
 * </p>
 *
 * @author 胡昊
 * @since 2020-07-23
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Schema(name = "SysUser对象")
public class SysUser implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.ASSIGN_ID)
    @Schema(description = "id")
    private String id;

    @Schema(description = "用户名")
    private String username;

    @Schema(description = "姓名")
    private String name;

    @Schema(description = "密码")
    private String password;

    @Schema(description = "性别 0-未知 1-男 2-女")
    private Integer gender;

    @Schema(description = "手机号")
    private String phone;

    @Schema(description = "邮箱")
    private String mail;

    @Schema(description = "用户头像")
    private String headerUrl;

    @Schema(description = "部门id")
    private String departmentId;

    @Schema(description = "用户类型 本地用户-LOCAL 授权中心-AUTH_CENTER")
    private String userSource;

    @Schema(description = "账户名是否过期 0-未过期 1-已过期")
    private Boolean isAccountNonExpired;

    @Schema(description = "账户是否锁定 0-未锁定 1-已锁定")
    private Boolean isAccountNonLocked;

    @Schema(description = "凭据是否过期 0-未过期 1-已过期")
    private Boolean isCredentialsNonExpired;

    @Schema(description = "状态 0-禁用 1-启用")
    private Boolean isEnabled;

    @Schema(description = "权重")
    private Integer weight;

    @TableField(fill = FieldFill.INSERT)
    @Schema(description = "创建时间")
    private Long createTime;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    @Schema(description = "更新时间")
    private Long updateTime;

    @TableField(fill = FieldFill.INSERT)
    @Schema(description = "创建者")
    private String createBy;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    @Schema(description = "更新者")
    private String updateBy;

    @Version
    @Schema(description = "版本")
    private Long version;

    @TableLogic
    @Schema(description = "是否有效 0-未删除 1-已删除")
    private Integer deleted;

    @Schema(description = "额外信息")
    private String extra;

    @Schema(description = "租户id")
    private String tenantId;
}
